feat: add settings-safe recovery mode - #23
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When the shell gets stuck in a startup crash loop, users currently face a
black screen (or a constantly restarting desktop) with no way to reach their
settings. This adds a Safe Mode: a recovery session in which the shell
starts normally but optional startup features are suppressed, while all
persisted settings remain untouched and repairable, with added
guidance to nod the users to github issues for bug reporting.
Safe Mode is activated by the session layer (see the matching
singularity-sessionPR: repeated session/shell crashes write a recoverymarker and relaunch the shell with
SINGULARITY_SAFE_MODE=1).Design
SafeModeis a process-wide singleton built from the environment:SINGULARITY_SAFE_MODE=1,SINGULARITY_SAFE_MODE_MARKER(marker path),SINGULARITY_SAFE_MODE_REASON(why recovery is active).consult
SafeMode.allows(feature)at runtime instead of rewriting orclearing configured values. In safe mode the settings UI still shows the
configured state and repairs are persisted; they simply take effect on the
next normal login.
SafeFeature):TILING,PLUGINS,CUSTOM_WIDGETS,HAND_CONTROL,SESSION_RESTORE,AUTOSTART.Changes
src/core/safe_mode.vala(new):SafeFeatureenum +SafeModesingletonwith
allows(),clear_marker(), and marker path/reason accessors.src/core/main.vala: skip autostart, session-recovery snapshot/restore andwidget manifest preloading in safe mode; log the recovery reason and open
the Settings "Desktop" page shortly after startup so the repair surface is
immediately visible.
src/core/tiling_manager.vala+dock.vala: tiling and scrolling-tilingmodes stay off; configuration changes are persisted but no tiling protocol
requests are sent.
src/core/plugin_manager.vala: plugins don't load and can't beenabled/disabled while recovering.
src/core/hand_control_manager.vala: hand-control isn't started and analready-running instance is stopped; no crash-restart loop.
src/components/sidebar/pages/desktop_page.vala: new "Safe Mode" group —shows the recovery reason and a Restart Normal Session row that clears
the marker and logs out; the tiling switch explains that the configured
value is shown but inactive until the next normal login.
meson.build:safe-modeunit test.Testing
tests/safe_mode_test.vala(mesontest('safe-mode')): normal mode allowsevery feature, safe mode blocks every feature;
clear_marker()removes anexisting marker and is idempotent when it's already gone.
SINGULARITY_SAFE_MODE=1— desktop comes upwith tiling/plugins/autostart off, the Safe Mode panel is shown, and
Restart Normal Session clears the marker and logs out.
Related
singularity-sessionchange that detects repeated crashes andactivates this mode.
Tested on NixOS 26.11